home *** CD-ROM | disk | FTP | other *** search
-
-
-
- GGGGAAAAMMMMMMMMAAAA((((3333MMMM)))) GGGGAAAAMMMMMMMMAAAA((((3333MMMM))))
-
-
-
- NNNNAAAAMMMMEEEE
- lgamma, gamma, lgammal, gammal - log gamma function
-
- SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
- ####iiiinnnncccclllluuuuddddeeee <<<<mmmmaaaatttthhhh....hhhh>>>>
-
- ddddoooouuuubbbblllleeee ggggaaaammmmmmmmaaaa((((ddddoooouuuubbbblllleeee xxxx))));;;;
- ddddoooouuuubbbblllleeee llllggggaaaammmmmmmmaaaa((((ddddoooouuuubbbblllleeee xxxx))));;;;
- lllloooonnnngggg ddddoooouuuubbbblllleeee ggggaaaammmmmmmmaaaallll((((lllloooonnnngggg ddddoooouuuubbbblllleeee xxxx))));;;;
- lllloooonnnngggg ddddoooouuuubbbblllleeee llllggggaaaammmmmmmmaaaallll((((lllloooonnnngggg ddddoooouuuubbbblllleeee xxxx))));;;;
-
- eeeexxxxtttteeeerrrrnnnn iiiinnnntttt ssssiiiiggggnnnnggggaaaammmm;;;;
- eeeexxxxtttteeeerrrrnnnn iiiinnnntttt ssssiiiiggggnnnnggggaaaammmmllll;;;;
-
- DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
- lgamma and gamma return ln|(GAMMA(x))|, where GAMMA is the
- mathematical gamma function.
-
- gammal and lgammal are the long double versions of the log gamma
- function.
-
- gamma and lgamma are identical, as are gammal and lgammal.
-
- The external integer signgam returns the sign of GAMMA(x), and the
- external integer signgaml returns the sign of GAMMAL(x).
-
- IIIIDDDDIIIIOOOOSSSSYYYYNNNNCCCCRRRRAAAASSSSIIIIEEEESSSS
- Do nnnnooootttt use the expression signgam*exp(gamma(x)) to compute g := GAMMA(x).
- Instead use a program like this (in C):
- lg = gamma(x); g = signgam*exp(lg);
-
- Only after _g_a_m_m_a has returned can _s_i_g_n_g_a_m be correct. Note too that
- GAMMA(x) must overflow when x is large enough, and is undefined when x is
- a nonpositive integer.
-
- Analogous rules apply to gammal and signgaml.
-
- The following C program fragment might be used to calculate G if the
- overflow needs to be detected:
- if ((y = gamma(x)) > LN_MAXDOUBLE)
- error();
- y = signgam * exp(y);
-
- where LN_MAXDOUBLE is the least value that causes _e_x_p(3M) to overflow and
- is defined in the <_v_a_l_u_e_s._h> header file.
-
- Only in the UNIX math library for C was the name _g_a_m_m_a ever attached to
- ln G. Elsewhere (in some FORTRAN libraries) the name GAMMA belongs to G
- and the name ALGAMMA to ln G in single precision; in double the usual
- names are DGAMMA and DLGAMMA in FORTRAN. Why should C be different?
-
-
-
-
-
- PPPPaaaaggggeeee 1111
-
-
-
-
-
-
- GGGGAAAAMMMMMMMMAAAA((((3333MMMM)))) GGGGAAAAMMMMMMMMAAAA((((3333MMMM))))
-
-
-
- Archeological records suggest that C's _g_a_m_m_a originally delivered ln(G
- (x)). Later, the program _g_a_m_m_a was changed to cope with negative
- arguments in a more conventional way, but the documentation did not
- reflect that change correctly. The most recent change corrects
- inaccurate values when _x is almost a negative integer.
-
- Some math libraries have changed the name of this function to _l_g_a_m_m_a() to
- suggest its real functionality.
- On SGI systems, the name _g_a_m_m_a is currently maintained as a synonym to
- _l_g_a_m_m_a for compatibility. It may disappear in a future release.
-
- NNNNOOOOTTTTEEEESSSS
- lgamma and gamma are not ANSI-C functions. If you compile with flag
- -ansi or -ansiposix, you must supply your own prototypes for these
- functions or you will get incorrect results. (See the prototypes defined
- in /usr/include/math.h)
-
- DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
- In the diagnostics below, functions in the standard math library _l_i_b_m._a,
- are referred to as -_l_m versions, those in math library _l_i_b_m_x._a are
- referred to as -_l_m_x versions, and those in the the BSD math library
- _l_i_b_m_4_3._a are referred to as -_l_m_4_3 versions. The -_l_m and -_l_m_x versions
- always return the default Quiet NaN and set _e_r_r_n_o to EDOM when a NaN is
- used as an argument. A NaN argument usually causes the -_l_m_4_3 versions to
- return the same argument. The -_l_m_4_3 versions never set _e_r_r_n_o. The value
- of HUGE_VAL is IEEE Infinity.
-
- The _g_a_m_m_a functions return HUGE_VAL when the argument is zero or a
- negative integer. The -_l_m and -_l_m_x versions also set _e_r_r_n_o to EDOM.
- When the correct value would overflow, the _g_a_m_m_a functions return
- HUGE_VAL. The -_l_m and -_l_m_x versions also set _e_r_r_n_o to ERANGE.
-
- See matherr(3M) for a description of error handling for -_l_m_x functions.
-
- SSSSEEEEEEEE AAAALLLLSSSSOOOO
- math(3M), matherr(3M)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PPPPaaaaggggeeee 2222
-
-
-
-